package com.yc.fav.servlet;

import com.yc.fav.entity.FavFavorite;
import com.yc.fav.service.impl.FavFavoriteServiceImpl;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
import java.io.IOException;

@WebServlet(name = "AddServlet", value = "/add.do")
public class AddServlet extends HttpServlet {
    //业务层对象
    private FavFavoriteServiceImpl service = new FavFavoriteServiceImpl();

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("UTF-8");
        response.setCharacterEncoding("UTF-8");
        response.setContentType("application/json;charset=utf-8");

        //读取数据将数据封装在实体对象中
        String flabel = request.getParameter("fabel");
        String furl = request.getParameter("furl");
        String fdesc = request.getParameter("fdesc");
        String ftags = request.getParameter("ftags");
        FavFavorite ff =new FavFavorite();
        ff.setFdesc(fdesc);
        ff.setFlabel(flabel);
        ff.setFurl(furl);
        ff.setFtags(ftags);
        //调用业务层方法

    }
}
